package com.zr.wareHouseIdentify.Mapper;

import com.zr.wareHouseIdentify.pojo.WareHouseIdentify;
import com.zr.wareHouseIdentify.pojo.WareHouseIdentifyAdd;
import com.zr.wareHouseIdentify.pojo.WareHouseIdentifyUpdate;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * Created by jiangping on 2019/7/16.
 */
@Mapper
public interface WareHouseMapper {
    List<WareHouseIdentify> queryPage(WareHouseIdentify wareHouseIdentify);

    int queryCount(WareHouseIdentify wareHouseIdentify);

    @Select("select * from wareHouseIdentify where code = #{code}")
    List<WareHouseIdentify> queryByCodes( String code);
    @Select("select * from wareHouseIdentify where name = #{name}")
    List<WareHouseIdentify> queryByNames(String name);
    @Select("select * from wareHouseIdentify where id = #{id} ")
    List<WareHouseIdentify> queryById(@Param("id") Integer id );

    @Update("update wareHouseIdentify set code=#{code},name=#{name},remark=#{remark} where id = #{id}")
    int UpdateWarehouse(WareHouseIdentifyUpdate wareHouseIdentifyUpdate);
    @Insert("insert into wareHouseIdentify(code,name,remark,status) values(#{code},#{name},#{remark},#{status})")
    int addWarehouse(WareHouseIdentifyAdd wareHouseIdentifyAdd);
    @Update("update wareHouseIdentify set status = #{status} where id = #{id}")
    int updateStatus(WareHouseIdentify wareHouseIdentify);
}
